from django.conf.urls import url
from . import views
from rest_framework_jwt.views import obtain_jwt_token

urlpatterns = [
    url(r'^sms_codes/(?P<mobile>[1][13579][0-9]{9})/$',views.SMSCodeView.as_view()),
    url(r'^usernames/(?P<name>\w+)/count/$',views.UserNameView.as_view()),
    url(r'^mobiles/(?P<mobile>[1][13579][0-9]{9})/count/$',views.MobileView.as_view()),
    # 当进行post和put请求要携带数据来时，浏览器会有这个机制先以options请求方式
    # 请求后端是否允许这两个域名进行跨域，如果不允许不会把数据发送过去，也不会进行post请求
    url(r'^users/$',views.UserView.as_view()),
    url(r'^authorizations/$',views.UserAuthorizeView.as_view()),
    url(r'^user/$', views.UserDetailView.as_view()),
    url(r'^emails/$', views.UserEmailView.as_view()),
    url(r'^emails/verification/$', views.VerifyEmailView.as_view()),

]